package com.stone.bigdata.service.impl;

import com.stone.bigdata.dao.poc.ActiveCityDao;
import com.stone.bigdata.domain.ActiveCity;
import com.stone.bigdata.domain.AddCount;
import com.stone.bigdata.domain.VO.CityTotalVO;
import com.stone.bigdata.service.ActiveCityService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;
import java.sql.Timestamp;
import java.util.List;

@Service
public class ActiveCityServiceImpl implements ActiveCityService {
    @Autowired
    private ActiveCityDao activeCityDao;

    public void saveActiveCity() {
        ActiveCity activeCity = new ActiveCity();
        activeCityDao.saveActiveCity(activeCity);
    }

    public List<AddCount> listSixDayAdd(Date lastSix, Date lastOne) {
        List<AddCount> list = activeCityDao.listSixDayAdd(lastSix, lastOne);
//        list.forEach(item -> {
//            System.out.println(item.toString());
//        });
        return list;
    }

    public List<CityTotalVO> listActiveCity(Date yesterday) {
        return activeCityDao.listActiveCity(yesterday);
    }

    public  List<AddCount> listFiveAfter(Timestamp zero, Timestamp now) {
        return activeCityDao.listFiveAfter(zero, now);
    }
}
